//
//  MessagesV2.swift
//  imprint
//
//  Created by 小柠檬🍋 on 2025/3/11.
//

//取消name
class MessagesV2: Codable {
    var content: String
    var role: String
//    var name: String
    
    init(_ roleType: String, _ name: String, _ content: String) {
        self.content = content
        self.role = roleType
//        self.name = name.replacingOccurrences(of: "\\s", with: "", options: .regularExpression)
    }
}

class MessagesV3: Codable {
    var content: [MessageContentV2]
    var role: String
    var name: String
    
    init(_ roleType: String, _ name: String, _ content: [MessageContentV2]) {
        self.content = content
        self.role = roleType
        self.name = name.replacingOccurrences(of: "\\s", with: "", options: .regularExpression)
    }
}
protocol MessageProtocol: Codable {}

extension MessagesV2: MessageProtocol {}
extension MessagesV3: MessageProtocol {}
